<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-1.12.4.min.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>
    <link type="text/css" href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <script language="JavaScript">
        $(function () {
            $('.submit_form').click(function () {
                $.ajax({
                    type:"POST",
                    dataType:"json",
                    contentType : "application/x-www-form-urlencoded; charset=utf-8",
                    url:"http://127.0.0.1:9000/api/v1/user/register/",
                    data:$('#form_register').serialize(),
                    success:function (result) {
                        if(result.status === 200){
                            alert("注册成功");
                            window.location.href = "user_login.html"
                        }
                    }

                })
            })
        });
    </script>
</head>
<body>
<div class="container">
    <div class="col-lg-6">
    <form class="form-horizontal" id="form_register">

         <div class="form-group" style="margin-bottom: 40px">
            <div class="col-sm-offset-4">
                <h1 >欢迎加入Python1804</h1>
            </div>
         </div>

        <div class="form-group">
            <label for="inputEmail" class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-10 ">
              <input type="text" class="form-control" id="inputEmail" name="email" placeholder="请输入邮箱">
            </div>
        </div>

         <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" id="inputPassword" name="password" placeholder="Password">
            </div>
         </div>

        <div class="form-group">
            <label for="inputName" class="col-sm-2 control-label">昵称</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" name="username" id="inputName" >
            </div>
         </div>

        <div class="form-group">
            <label for="inputPhone" class="col-sm-2 control-label">手机号</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" name="phone" id="inputPhone" >
            </div>
         </div>

      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="button" class="btn btn-success btn-lg submit_form" style="width: 160px">点击注册</button>
        </div>
      </div>


</form>
</div>

    <div class="col-lg-4">
        <div style="margin-top: 140px;margin-left: 100px">
            <div><span>&raquo;已经拥有有账号?</span><a href="user_login.html">立即登录</a></div>
            <div>&raquo;<a href="index.html">返回首页</a></div>
        </div>
    </div>

</div>
</body>
</html>